package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.GameBean;
import com.mz.ozy.mvp.model.GameModel;
import com.mz.ozy.mvp.view.GameContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class GamePresenter extends BasePresenterImpl<GameContract.View> implements GameContract.Presenter {

    private GameModel mModel;

    public GamePresenter() {
        mModel = new GameModel();
    }

    @Override
    public void geAssetsInfo(Activity activity, boolean isShow) {
        mModel.geAssetsInfo(activity)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<GameBean>(mView, isShow) {
                    @Override
                    public void onSuccesss(GameBean bean) {
                        mView.geAssetsInfoSuccess(bean);
                    }
                });
    }
}
